package day13;
/**
 * 布局练习
 */
import java.awt.BorderLayout;
import java.awt.Dimension;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;

public class JFrameDemo2 {
	public static void main(String[] args) {
		JFrame frame = new JFrame("欢迎");
		JPanel panel = new JPanel();
		frame.add(panel);
		panel.setLayout(new BorderLayout());
		
		JButton button1 = new JButton("logan");
		JButton button2 = new JButton("victoria");
		JButton button3 = new JButton("henhao");
		panel.add(button1,BorderLayout.EAST);
		panel.add(button2,BorderLayout.CENTER);
		panel.add(button3,BorderLayout.SOUTH);
		button1.setPreferredSize(new Dimension(200, 250));
		frame.setSize(500, 500);
		frame.setLocation(530, 430);
		frame.setVisible(true);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	}
}
